#include "gtest/gtest.h"

#include "stream/Topic.h"
using namespace stream;

TEST(TopicTest, test){
	const std::string expectName = "hello";
	const std::string expectDirectory = ".";
	auto stream = std::shared_ptr<Topic>(::stream::makeTopic(expectName, expectDirectory));
	ASSERT_EQ(stream->name(), expectName);
	ASSERT_EQ(stream->directory(), expectDirectory);

	ASSERT_TRUE(stream->open());
	ASSERT_TRUE(stream->isOpened());

	stream->close();
	ASSERT_FALSE(stream->isOpened());
}
